05. Exercise: Write a Basic Espresso Test

Exercise: Write a Basic Espresso Test

Write a Basic Espresso Test

It's time to write your first Espresso test in TeaTime. We'll start by adding an OrderActivityBasicTest which will demo a user clicking on the decrement button. The test will verify that this action properly decreases the quantity and the total cost.

Remember to follow the 3 General steps of Espresso View Testing:

  1. Find the view
  2. Perform action on the view
  3. Check if the view does what you expected

Also, remember Google’s handy Espresso Cheat Sheet for possible Matchers, Actions, and Assertions.

Exercise Code

Exercise: TESP.01-Exercise-FinishOrderActivityBasicTest

Task List:

Task Feedback:

High five! First Espresso test done :)

Solution: [TESP.01-Solution-FinishOrderActivityBasicTest][Diff]